package com.wc.AlgoOJ.LQ1036T;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/8 8:39
 * 数的分解
 * http://43.138.190.70:8888/p/LQ1036T
 * @description
 */
public class Main {
    static int ans = 0;
    static int[] pre = new int[2501];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 1; i <= 2500; i++) {
            pre[i] = pre[i - 1];
            if (check(i)) {
                ++pre[i];
            }
        }
        while (n-- > 0) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int[] dp = new int[11];

        }
    }

    // 暴力过不了
    public static void sep(int start, int sum, int step) {
        if (start > sum) {
            return;
        }
        if (step == 1) {
            if (!check(sum)) {
                ans++;
            }
            return;
        }

        int end = sum / step;

        for (int i = start; i <= end; i++) {
            if (check(i)) {
                continue;
            }
            sep(i + 1, sum - i, step - 1);
        }
    }

    public static boolean check(int val) {
        int ma;
        while (val > 0) {
            ma = val % 10;
            if (ma == 2 || ma == 4) {
                return true;
            }
            val /= 10;
        }
        return false;
    }
}
